package com.idis.common.util;

import java.util.Date;
import java.util.Random;

/**
 * Created by Ming on 2018/2/4.
 */

/**
 * 用以生成随机ID
 */
public class RandomUtil {

    /**
     * 利用时间戳与一个两位随机数生成随机id
     * @return id
     */
    public static Long randomLongId(){
        Date date=new Date();
        Random rand=new Random();
        Long timeStamp=date.getTime();
        String time=timeStamp.toString();
        String random= String.valueOf(rand.nextInt(100));
        time+=random;
        return Long.valueOf(time);
    }
}
